/*
 * @Autor: Kadia
 * @Date: 2021-07-01 07:20:11
 * @LastEditors: Kadia
 * @Connect: nefukadia@foxmail.com
 * @LastEditTime: 2021-07-01 09:20:54
 */
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import myConfig from './myConfig'
import axios from 'axios'
import VueCookies from 'vue-cookies'

import myMenu from './components/myMenu.vue';
import myFooter from './components/myFooter.vue';

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

axios.defaults.withCredentials=true;

Vue.prototype.$axios=axios;
Vue.prototype.myConfig=myConfig;

Vue.use(VueCookies);
Vue.use(ElementUI);

Vue.component('myMenu',myMenu);
Vue.component('myFooter',myFooter);

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})

router.beforeEach((to, from, next) => {
  /* 路由发生变化修改页面title */
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})
